package com.surpassun.emall.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Xun Ren : sakyrenxun@gmail.com
 */
@Entity
public class Address implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;
    
    private long countryId;
    
    private long provinceId;
    
    private long cityId;
    
    @NotNull
    @Column(length = 75)
    private String postCode;
    
    @NotNull
    @Column(length = 200)
    private String street;
    
    @Column(length = 500)
    private String complememt;
    
    @Transient
    private String fullAddress;
    
    public Address() {
    }
    
	public Address(long countryId, long provinceId, long cityId,
			String postCode, String street, String complememt) {
		super();
		this.countryId = countryId;
		this.provinceId = provinceId;
		this.cityId = cityId;
		this.postCode = postCode;
		this.street = street;
		this.complememt = complememt;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getCountryId() {
		return countryId;
	}

	public void setCountryId(long countryId) {
		this.countryId = countryId;
	}

	public long getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(long provinceId) {
		this.provinceId = provinceId;
	}

	public long getCityId() {
		return cityId;
	}

	public void setCityId(long cityId) {
		this.cityId = cityId;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getComplememt() {
		return complememt;
	}

	public void setComplememt(String complememt) {
		this.complememt = complememt;
	}
}